﻿
using System;

namespace HmFramework.Threading
{

	public class ThreadSafeBase
	{

		private Int32 millisecondsTimeoutOnLock = 30;
		private object _syncRoot = new object();

		public object SyncRoot
		{
			get { return _syncRoot; }
		}

		public Int32 MillisecondsTimeoutOnLock
		{
			get { return millisecondsTimeoutOnLock; }
			set { millisecondsTimeoutOnLock = value; }
		}

		public DisposableLocker CreateLocker()
		{
			return new DisposableLocker(SyncRoot, MillisecondsTimeoutOnLock);
		}
	}
}
